
import {IonicPage, NavController, NavParams} from "ionic-angular";
import {Component} from "@angular/core";
import {HttpService} from "../../../providers/HttpService";
import {NativeServiceC} from "../../../providers/NativeServiceC";

@IonicPage()
@Component({
  selector: 'page-homeDetail',
  templateUrl: 'bookDetail.html'
})

export class BookDetailPage{


  private bookDetailUrl:string ='/book/';
  private bookDetailID=this.navParams.get('id') || 202;
  bookDetailObj={};

  constructor(
    public navCtrl:NavController,
    private http:HttpService,
    private nativeService:NativeServiceC,
    private navParams:NavParams
  ){}

  ionViewDidLoad(){
   this.bookDetailFun();
  }

   private bookDetailFun(){
     this.http.get(this.bookDetailUrl+this.bookDetailID).subscribe(res=>{
       this.bookDetailObj = res;
       console.log(this.bookDetailObj);
       this.nativeService.hideLoading();
     })
   }

}
